package com.googlecode.tidej.client.project;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.googlecode.tidej.client.util.DataSource;

public class MemoryDataSource implements DataSource {

  private String content;
  
  public MemoryDataSource(String string) {
    this.content = string;
  }

  @Override
  public void getContent(AsyncCallback<String> callback) {
    callback.onSuccess(content);
  }

  @Override
  public void setContent(String string, AsyncCallback<Void> callback) {
    content = string;
    if (callback != null) {
      callback.onSuccess(null);
    }
  }

}
